<% @page_title = "Edit reader information" %>
<%= stylesheet_link_tag "admin/form", :media => "all" %>
<div class="edit-reader">
	<h1>Edit reader information</h1>
	<%= form_for :user,
	:url => {:controller => "admin/user", :action => "update", :id => @user.id},
	:method => "put" do |f| %>
		<p>
			<label>Full Name</label>
			<%= f.text_field :fullname %>
		</p>
		<p>
			<label>Card ID</label>
			<%= f.text_field :card_id %>
		</p>
		<p>
			<label>Username</label>
			<%= f.text_field :username %>
		</p>
		<p>
			<label>Student/Staff ID</label>
			<%= f.text_field :reader_id %>
		</p>
		<p>
			<label>Email</label>
			<%= f.text_field :email %>
		</p>
		<p>
			<label>Phone</label>
			<%= f.text_field :phone %>
		</p>
		<p>
			<label>Reader Group</label>
			<%= collection_select(:user, :role_id, Role.all, :id, :role_name, {:selected => @user.role_id}) %>
		</p>
		<p>
			<label>Faculty/Department</label>
			<%= collection_select(:user, :faculty_id, Faculty.all, :id, :faculty_name, {:selected => @user.faculty_id}) %>
		</p>
		
		<p class='action'>
			<label>&nbsp;</label>
			<%= f.submit :Save %><%= link_to "Back", :controller => "admin/user", :action => "index" %>
		</p>
	<% end %><!-- End form -->
</div><!-- End .edit-user -->

<div class='clear'></div>

<% if @user.errors.any? %>
	<ul>
	<% @user.errors.full_messages.each do |msg| %>
		<li>&nbsp;<%= msg %></li>
	<% end %>
	</ul>
<% end %><!-- End if -->
<br />
